﻿<%@ Page Language="C#"  MasterPageFile="~/membercenter/membercenter.Master" AutoEventWireup="true" CodeBehind="shop_friendship_link.aspx.cs" Inherits="YXShop.Web.membercenter.shop.shop_administer.shop_friendship_link" %>

<asp:Content ID="ContHead" runat="server" ContentPlaceHolderID="head">
<script src="../../../admin/scripts/public.js" type="text/javascript"></script>
<script src="../../../scripts/prototype.js" type="text/javascript"></script>
<link href="../../../admin/style/admin.css" rel="stylesheet" type="text/css" />
<link href="../../../style/validator.css" rel="stylesheet" type="text/css" />
<link href="../../../style/toolbar.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" language="javascript">
 function Del(id)
    { 
       if(confirm('确定要永久删除该信息吗?删除后将不能被恢复!'))
       {
            var param = "Option=del&id=" + id;
            var options = 
            { method: 'post',parameters: param,onComplete:
                 function(transport)
                 {
                     var retv = transport.responseText;
                     window.location.reload();
                 }
            }
        }
        else
        {
            return false;
        }
        new Ajax.Request('shop_friendship_link.aspx', options);
    }
function SelectAll(tempControl)
{
      var theBox=tempControl;
      xState=theBox.checked;    
      elem=theBox.form.elements;
      for(i=0;i<elem.length;i++)
      if(elem[i].type=='checkbox' && elem[i].id!=theBox.id)
      {
        if(elem[i].checked!=xState)
           elem[i].click();
                        
      }
}   

 function DelAll(id)
    { 
       var idStr;
       if(id<0)
       {
            idStr = GetAllChecked();
            if(idStr == "")
            {
                alert("您没有选择要删除的信息!");
                return;
            }
       }
       else
       {
           idStr=id
       }
       if(confirm('确定要永久删除该信息吗?删除后将不能被恢复!'))
       {
            var param = "Option=delAll&id=" + idStr;
            var options = 
            { method: 'post',parameters: param,onComplete:
                 function(transport)
                 {
                     var retv = transport.responseText;
                     window.location.reload();
                 }
            }
        }
        else
        {
            return false;
        }
        new Ajax.Request('shop_friendship_link.aspx', options);
    }
    
    function SetLeavel(id)
    {
        var leavelid=$("leavel"+id).value;
        var num="^[0-9]*[1-9][0-9]*$";
        if(leavelid.search(num)!=0)
        {
          return false;
        }
        var param = "Option=leavel&leavelID="+leavelid+"&id=" + id;
        var options = 
        { method: 'post',parameters: param,onComplete:
             function(transport)
             {
                 var retv = transport.responseText;
                 if(retv=="ok")
                 {
                    window.location.href=window.location.href;
                 }
             }
        }
        new Ajax.Request('shop_friendship_link.aspx', options);
    }
</script>
</asp:Content>
<asp:Content ID="ContTitle" runat="server" ContentPlaceHolderID="pagetitle">
友情链接管理
</asp:Content>
<asp:Content ID="ContInfo" runat="server" ContentPlaceHolderID="pageinfo">
<a href="#" onclick="DelAll(-1)">批量删除</a>
</asp:Content>
<asp:Content ID="ContMain" runat="server" ContentPlaceHolderID="workspace">
<asp:Literal ID="litlist" runat="server"></asp:Literal>
</asp:Content>